/*
 * @Descripttion: 
 * @Author: yuxi
 * @Date: 2022-10-11 20:54:24
 * @LastEditors: yuxi
 * @LastEditTime: 2022-10-11 21:06:35
 */
/*
 * @Descripttion:
 * @Author: yuxi
 * @Date: 2021-01-22 23:42:57
 * @LastEditors: yuxi
 * @LastEditTime: 2021-02-28 20:10:54
 */
import { axios } from './request'

/**
 * login func
 * parameter: {
 *     username: '',
 *     password: '',
 *     remember_me: true,
 *     captcha: '12345'
 * }
 * @param parameter
 * @returns {*}
 */
export function findAndCountAll (parameter) {
  return axios({
    url: `attrs/${parameter.table}/all`,
    method: 'post',
    data: parameter
  })
}

 
export function findOne (parameter) {
  return axios({
    url: `attr/${parameter.table}/${parameter.id}`,
    method: 'post',
    data: parameter
  })
}

export function createOne (parameter) {
  return axios({
    url: `attrs/${parameter.table}`,
    method: 'post',
    data: parameter
  })
}

export function updateOne (parameter) {
  return axios({
    url: `attr/${parameter.table}/${parameter.id}`,
    method: 'put',
    data: parameter
  })
}

export function deleteOne (parameter) {
  return axios({
    url: `attr/${parameter.table}/${parameter.id}`,
    method: 'delete',
    data: parameter
  })
}
 